package com.etone.system.service.impl;

import java.util.List;
import java.util.Map;

import com.etone.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.etone.system.mapper.FiveCtuRecordMapper;
import com.etone.system.domain.FiveCtuRecord;
import com.etone.system.service.IFiveCtuRecordService;

/**
 * CTU库存信息Service业务层处理
 *
 * @author etone
 * @date 2025-05-27
 */
@Service
public class FiveCtuRecordServiceImpl implements IFiveCtuRecordService
{
    @Autowired
    private FiveCtuRecordMapper fiveCtuRecordMapper;

    /**
     * 查询CTU库存信息
     *
     * @param id CTU库存信息主键
     * @return CTU库存信息
     */
    @Override
    public FiveCtuRecord selectFiveCtuRecordById(Long id)
    {
        return fiveCtuRecordMapper.selectFiveCtuRecordById(id);
    }

    /**
     * 查询CTU库存信息列表
     *
     * @param fiveCtuRecord CTU库存信息
     * @return CTU库存信息
     */
    @Override
    public List<FiveCtuRecord> selectFiveCtuRecordList(FiveCtuRecord fiveCtuRecord)
    {
        return fiveCtuRecordMapper.selectFiveCtuRecordList(fiveCtuRecord);
    }

    /**
     * 新增CTU库存信息
     *
     * @param fiveCtuRecord CTU库存信息
     * @return 结果
     */
    @Override
    public int insertFiveCtuRecord(FiveCtuRecord fiveCtuRecord)
    {
        fiveCtuRecord.setCreateTime(DateUtils.getNowDate());
        return fiveCtuRecordMapper.insertFiveCtuRecord(fiveCtuRecord);
    }

    /**
     * 修改CTU库存信息
     *
     * @param fiveCtuRecord CTU库存信息
     * @return 结果
     */
    @Override
    public int updateFiveCtuRecord(FiveCtuRecord fiveCtuRecord)
    {
        return fiveCtuRecordMapper.updateFiveCtuRecord(fiveCtuRecord);
    }

    /**
     * 批量删除CTU库存信息
     *
     * @param ids 需要删除的CTU库存信息主键
     * @return 结果
     */
    @Override
    public int deleteFiveCtuRecordByIds(Long[] ids)
    {
        return fiveCtuRecordMapper.deleteFiveCtuRecordByIds(ids);
    }

    /**
     * 删除CTU库存信息信息
     *
     * @param id CTU库存信息主键
     * @return 结果
     */
    @Override
    public int deleteFiveCtuRecordById(Long id)
    {
        return fiveCtuRecordMapper.deleteFiveCtuRecordById(id);
    }

    @Override
    public void deleteFiveCtuRecordByStorageIdAndwuliaoInfo(Map<String, Object> map) {
        fiveCtuRecordMapper.deleteFiveCtuRecordByStorageIdAndwuliaoInfo(map);
    }
}
